package user.controller;

import common.model.Propaganda;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import user.Service.PropagandaService;

import java.util.List;

@RestController
@RequestMapping("/user/propaganda")
public class PropagandaController {

    @Autowired
    private PropagandaService propagandaService;

    @GetMapping
    public ResponseEntity<List<Propaganda>> getUserPropaganda(@RequestParam(required = false) String type) {
        return ResponseEntity.ok(propagandaService.getUserPropaganda(type));
    }
}